<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<html>
	<head>
		<title>文章列表</title>
		<link href="css/general.css" rel="Stylesheet" type="text/css" />
	</head>

	<body id="listNewsPage">
		<div align="center">
			<s:form action="listNews" method="post">
				<%--下面三句可以不动			--%>
				<s:hidden name="page"></s:hidden>
				<s:if test="#request.pageView.totalRecord">
					<table class="admin_table">
						<tr>
							<td>
								编号
							</td>
							<td>
								标题
							</td>
							<td>
								类型
							</td>
							<td>
								概要
							</td>
							<td>
								关键字
							</td>
							<td>
								图片
							</td>
							<td>
								操作者
							</td>
							<td>
								创建时间
							</td>
							<td>
								修改时间
							</td>
							<td>
								操作
							</td>
						</tr>
						<s:iterator value="#request.pageView.records" id="entity">
							<tr>
								<td>
									${id}
								</td>
								<td>
									${title }
								</td>
								<td>
									<s:if test="%{#entity.categoryId == 1}">
    	公告
        </s:if>
									<s:if test="%{#entity.categoryId == 2}">
                      新闻
        </s:if>
								</td>
								<td>
									${outline }
								</td>
								<td>
									${keyWords }
								</td>
								<td>
									<s:if test="%{#entity.image != null}">
    									<img alt="cover" class="newest_img"
										src="userfiles/image/${image}" />
      								  </s:if>
									<s:else>
                     					<img alt="cover" class="newest_img"
										src="images/noImage.jpg" />
      								  </s:else>
									
								</td>
								<td>
									${operator }
								</td>
								<td>
									<s:date name='gmtCreate' format='yyyy-MM-dd HH:mm' />
								</td>
								<td>
									<s:date name='gmtModify' format='yyyy-MM-dd HH:mm' />
								</td>
								<td>
									<a
										href='<s:url action="editNews"><s:param name="id" value="id" /></s:url>'>修改</a>&nbsp;
									<a onclick="return confirm('确定要删除吗？');"
										href='<s:url action="delNews"><s:param name="id" value="id" /></s:url>'>删除</a>
								</td>
							</tr>
						</s:iterator>
					</table>
					<s:include value="/share/page.jsp" />
				</s:if>
				<s:else>
				没有记录
				</s:else>

				<p>
					<a href='<s:url action="beforeAddNews" />'>新增文章</a>
				</p>
			</s:form>
		</div>
	</body>
</html>
